package org.cloud.demo1.client.fallbackfactory;

import org.cloud.demo1.client.client.Demo1TestClient;
import org.cloud.demo1.client.entity.UserOfDemo1;

import feign.hystrix.FallbackFactory;

/**
 * Demo1TestClient调用回退类
 * @author wangyuan
 * @since 2019年6月2日 下午10:38:38
 *
 */
public class Demo1TestClientFallbackFactory implements FallbackFactory<Demo1TestClient> {

	@Override
	public Demo1TestClient create(Throwable cause) {
		return new Demo1TestClient() {
			
			@Override
			public String testMethod1OfDemo1() {
				return "发生了错误，进入了fallback回退方法";
			}

			@Override
			public UserOfDemo1 testMethod2OfDemo1() {
				return new UserOfDemo1();
			}
		};
	}

	

}
